package lab01;

/**
 * Created by tanfei on 2017/10/8.
 */
public class Test05 {
    public static void main(String[] args) {
        //for
        int sum1 = 0;
        for (int i = 1; i <= 100; i++) {
            sum1 += i;
            System.out.println(sum1);
        }
            //while
        int n=100;
        int j=1,sum2=0;
        while(j<=n){
            sum2=sum2+j;
        }
        System.out.println(sum2);
        //do while
        int y=1,sum3=0;
        int x=100;
        do{
            System.out.println(sum3=sum3+y);
        }
        while(y<=x);
        }
    }

